package com.ggggeeennn.studentUser.controller.exam;

import com.ggggeeennn.common.core.controller.BaseController;
import com.ggggeeennn.common.core.domain.AjaxResult;
import com.ggggeeennn.common.core.page.TableDataInfo;
import com.ggggeeennn.studentUser.service.StudentScoreService;
import com.ggggeeennn.score.domain.Score;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/student/score")
public class StudentScoreController extends BaseController {

    @Autowired
     private StudentScoreService studentScoreService;

    //学生分数列表
    @GetMapping("/list")
    public TableDataInfo getScoreListByUserId(Long userId, Integer pageNum, Integer pageSize){
        List<Score> list= studentScoreService.getScoreListByUserId(userId,pageNum,pageSize);
        return getDataTable(list);
    }



    //学生提交考试
    @PostMapping("/submitPaper")
    public AjaxResult  submitPaper(@RequestBody Score score){
        return toAjax(studentScoreService.submitExam(score));
    }
}
